<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        section {
            /* 随着宽度自由伸缩 */
            width: 100%;
            /* 指定最大不超过980像素 */px
            max-width: 980px;
            /* 指定最小不小于320px */
            min-width: 320px;
        }
        section div {
            float: left;
            width: 50%;
            height: 400px;
        }
        section div:nth-child(1) {
            background-color: blueviolet;
        }
        section div:nth-child(2) {
            background-color: coral;
        }
    </style>
</head>
<body>
   <section>
       <div></div>
       <div></div>
   </section>
</body>
</html>